package com.tao.springBootJedis.controller;

import org.joda.time.DateTime;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledTask {

    // cron表达式设置执行规则
    //@Scheduled(cron = "0 0 20 * * ?")
//    0/5 * * * * *
    @Scheduled(cron = "0/5 * * * * * ")
    public void remind() {
        //获取查询日期，获取第二天日期
        DateTime dateTime = new DateTime().plusDays(1);
        String dateString = dateTime.toString("yyyy-MM-dd");
        System.out.println(dateString);
        //调用方法查询
    }
}